package com.example.j20240419springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;

@Slf4j
@Component
@Aspect
public class AspectDemo5 {
    @Around("@annotation(com.example.j20240419springaop.config.MyAspect)")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
        log.info("before  ");
        Object result = joinPoint.proceed();
        log.info("after " );
        return result;
    }
}
